// $Id: setstyle.js 7935 2007-07-30 01:01:38Z a1155544 $
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
  // check for textsize cookie
  // if non-existent or different from newly called value then
  // set cookie with new value
  var cookiename = "uoa_textsize=";
  var allcookies = document.cookie;
  var pos = allcookies.indexOf(cookiename);
  var value = "";
  if (pos != -1) {
    var start = pos + cookiename.length;
    var end = allcookies.indexOf(";", start);
    if (end == -1) end = allcookies.length;
    value = allcookies.substring(start, end);
    value = unescape(value);
  }
  if (value != title) {
    var cookietitle = escape(title);
    document.cookie = cookiename + cookietitle + "; path=/";
  }

  return false;
}

function setTextSize() {
  // This function to be called by page's onLoad handler
  // check for textsize cookie
  var cookiename = "uoa_textsize=";
  var allcookies = document.cookie;
  var pos = allcookies.indexOf(cookiename);
  var value = "";
  if (pos != -1) {
    var start = pos + cookiename.length;
    var end = allcookies.indexOf(";", start);
    if (end == -1) end = allcookies.length;
    value = allcookies.substring(start, end);
    value = unescape(value);
    // cookie exists, so set style sheet for its value
    setActiveStyleSheet(value);
  }
}

function gothere(){
  var box = document.quicklinks.navbox;
  var where_to = box.options[box.options.selectedIndex].value;
  if (where_to == "") {
    return;
  } else {
    window.location = where_to;
  }
}
